/**
 */
package org.xtext.context.aware.eventX.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.xtext.context.aware.eventX.EventXPackage;
import org.xtext.context.aware.eventX.PlaySound;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Play Sound</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.context.aware.eventX.impl.PlaySoundImpl#getPlaySound <em>Play Sound</em>}</li>
 *   <li>{@link org.xtext.context.aware.eventX.impl.PlaySoundImpl#getSoundFileName <em>Sound File Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PlaySoundImpl extends MinimalEObjectImpl.Container implements PlaySound
{
  /**
   * The default value of the '{@link #getPlaySound() <em>Play Sound</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPlaySound()
   * @generated
   * @ordered
   */
  protected static final String PLAY_SOUND_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getPlaySound() <em>Play Sound</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPlaySound()
   * @generated
   * @ordered
   */
  protected String playSound = PLAY_SOUND_EDEFAULT;

  /**
   * The default value of the '{@link #getSoundFileName() <em>Sound File Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSoundFileName()
   * @generated
   * @ordered
   */
  protected static final String SOUND_FILE_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getSoundFileName() <em>Sound File Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSoundFileName()
   * @generated
   * @ordered
   */
  protected String soundFileName = SOUND_FILE_NAME_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected PlaySoundImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return EventXPackage.Literals.PLAY_SOUND;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getPlaySound()
  {
    return playSound;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setPlaySound(String newPlaySound)
  {
    String oldPlaySound = playSound;
    playSound = newPlaySound;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EventXPackage.PLAY_SOUND__PLAY_SOUND, oldPlaySound, playSound));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getSoundFileName()
  {
    return soundFileName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSoundFileName(String newSoundFileName)
  {
    String oldSoundFileName = soundFileName;
    soundFileName = newSoundFileName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EventXPackage.PLAY_SOUND__SOUND_FILE_NAME, oldSoundFileName, soundFileName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_SOUND__PLAY_SOUND:
        return getPlaySound();
      case EventXPackage.PLAY_SOUND__SOUND_FILE_NAME:
        return getSoundFileName();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_SOUND__PLAY_SOUND:
        setPlaySound((String)newValue);
        return;
      case EventXPackage.PLAY_SOUND__SOUND_FILE_NAME:
        setSoundFileName((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_SOUND__PLAY_SOUND:
        setPlaySound(PLAY_SOUND_EDEFAULT);
        return;
      case EventXPackage.PLAY_SOUND__SOUND_FILE_NAME:
        setSoundFileName(SOUND_FILE_NAME_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_SOUND__PLAY_SOUND:
        return PLAY_SOUND_EDEFAULT == null ? playSound != null : !PLAY_SOUND_EDEFAULT.equals(playSound);
      case EventXPackage.PLAY_SOUND__SOUND_FILE_NAME:
        return SOUND_FILE_NAME_EDEFAULT == null ? soundFileName != null : !SOUND_FILE_NAME_EDEFAULT.equals(soundFileName);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (playSound: ");
    result.append(playSound);
    result.append(", soundFileName: ");
    result.append(soundFileName);
    result.append(')');
    return result.toString();
  }

} //PlaySoundImpl
